During execution, a software object may contain one or more active threads of execution and may access one or more other software objects. A thread of execution within an object may enter a permanently halted state (a hung state) for a number of reasons. These reasons include: a mutually exclusive resource conflict, an external error (such as an event from a device never occurring), and coding logic error (such as an infinite loop).
To enable a system to detect when a thread of execution has entered a halted state, software objects are typically coded with logic that generates a heartbeat at defined time intervals, and conveys this heartbeat to a monitoring object. A heartbeat is a signal that is emitted at regular intervals by a software object to demonstrate to another software object (the monitoring object) that it is still running (that is, it is not halted). If the monitoring object does not receive a heartbeat within the defined time then the monitoring object regards the thread of execution as halted.
This type of heartbeat system has several disadvantages. For example, the monitoring object must be aware of all of the heartbeats that are present in the system, and the defined time interval for each heartbeat, so that it can ascertain if a heartbeat has been missed. As the number of objects generating a heartbeat increases, the management overhead increases for the monitoring object. Furthermore, every object having a thread of execution that may enter a halt state must have its own code to generate a heartbeat, which is an inefficient use of code. This is also an inefficient use of processing time, since every object automatically produces a regular heartbeat.